using UnityEngine;
using System.Collections;

public class Battery : MonoBehaviour
{
    #region Attributes

    public float damage = -0.166666f;
	public GameObject particleEffect;

    #endregion

    #region Unity Methods

    void OnTriggerEnter(Collider other)
    {
        if (other.tag == TagConstants.TAG_PLAYER)
        {
			
            GameControl.FindPlayer().ChangeEnergy(this.damage, false);
			GameObject.Instantiate(this.particleEffect, this.transform.position, Quaternion.identity);
            GameObject.Destroy(this.gameObject);
        }
    }

    #endregion    
}
